package com.borko.healthcare.persistence.hibernate.services;

import java.util.List;

import com.borko.healthcare.entities.interfaces.MedicineOrder;
import com.borko.healthcare.persistence.hibernate.dao.MedicineOrderDAO;

public class MedicineOrderManagerImpl implements MedicineOrderManager {
	
	private MedicineOrderDAO medicineOrderDAO;

	public MedicineOrderDAO getMedicineOrderDAO() {
		return this.medicineOrderDAO;
	}

	public void setMedicineOrderDAO(MedicineOrderDAO medicineOrderDAO) {
		this.medicineOrderDAO = medicineOrderDAO;
	}

	public void add(MedicineOrder medicineOrder) {
		medicineOrderDAO.create(medicineOrder);
	}

	public void applyChanges(MedicineOrder medicineOrder) {
		medicineOrderDAO.update(medicineOrder);
	}

	public List<MedicineOrder> list() {
		return medicineOrderDAO.retrive();
	}

	public void remove(MedicineOrder medicineOrder) {
		medicineOrderDAO.delete(medicineOrder);
	}

	public MedicineOrder getMedicineOrder(int id) {
		return medicineOrderDAO.getMedicineOrder(id);
	}

}
